//
//  DoPractiveScrollView.m
//  ZHIDOU
//
//  Created by 向礼 on 2018/12/22.
//  Copyright © 2018 向礼. All rights reserved.
//

#import "DoPractiveScrollView.h"

@interface DoPractiveScrollView()<UIScrollViewDelegate>

/// 混动试图
@property (nonatomic ,strong)UIScrollView *scrollView;

@end

@implementation DoPractiveScrollView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setUpSubView];
    }
    return self;
}


#pragma mark - UI

-(void)setUpSubView{
    self.backgroundColor = UIColorFromRGB(0xFFD62C);
    [self addSubview:self.scrollView];
    for (int i = 0; i<10; i++) {
        UIButton *bt = [UIButton buttonWithType:UIButtonTypeSystem];
        bt.backgroundColor = [UIColor whiteColor];
        bt.layer.cornerRadius = 13;
        bt.layer.masksToBounds = YES;
        bt.frame = CGRectMake(20+80*i, 10, 70, 26);
        [bt setTitle:@"几何函数" forState:UIControlStateNormal];
        [bt setTintColor:[UIColor blackColor]];
        bt.titleLabel.font = [UIFont systemFontOfSize:12];
        [self.scrollView addSubview:bt];
    }
}

- (UIScrollView *)scrollView {
    if (!_scrollView) {
        _scrollView = [[UIScrollView alloc] init];
        _scrollView.frame = CGRectMake(0, 0, ZD_screenWidth, 46);
        _scrollView.delegate = self;
        //_scrollView.pagingEnabled = YES;
        _scrollView.backgroundColor = [UIColor clearColor];
        _scrollView.showsVerticalScrollIndicator = NO;
        _scrollView.showsHorizontalScrollIndicator = NO;
        _scrollView.contentSize = CGSizeMake(ZD_screenWidth*2, 0);
        // _scrollView.backgroundColor = [UIColor colorWithWhite:1 alpha:0];
    }
    return _scrollView;
}


@end
